package com.db.user.mapper;

import com.db.user.entity.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 角色管理 Mapper 接口
 * </p>
 *
 * @author db
 * @since 2023-10-27
 */
public interface RoleMapper extends BaseMapper<Role> {

    @Select("SELECT name FROM qf_user_role\n" +
            "LEFT JOIN qf_role ON role_id = qf_user_role.id\n" +
            "WHERE user_id = #{userId}")
    List<String> selectRoleNamesByUserId(String userId);
}
